#ifndef ALIVECONSUMER_H_
#define ALIVECONSUMER_H_

#include <QUdpSocket>
#include <QThread>
#include <QDebug>

#ifdef Q_OS_UNIX

	/* Standard POSIX headers */
	#include <netinet/in.h>
	#include <netdb.h>
	#include <sys/socket.h>
	#include <arpa/inet.h>

#endif

#ifdef Q_OS_WIN

	/* WINSOCK header - it suck like windows >_> */
	#include <winsock.h>

#endif

/* Standard headers */
#include <errno.h>
#include <string.h>

#include "MessageParser.h"

class AliveConsumer : public QThread
{
	Q_OBJECT
	
private:
	QUdpSocket *sock;
	quint16 port;
	unsigned char ttl;
	
public:
	AliveConsumer();
	virtual ~AliveConsumer();
	void run();		//override the run function of QThread

private slots:
	void readMulticastDatagram();
	
};

#endif /*ALIVECONSUMER_H_*/
